package week11;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author The setting sun
 * @version 1.0
 * @title: ServerTest
 * @description: TODO
 * @date 2021/11/17 9:14
 */
public class ServerTest {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(7777);

        Socket clientSocket = ss.accept();

        OutputStream os = clientSocket.getOutputStream();
        DataOutputStream dos = new DataOutputStream(os);

        InputStream is = clientSocket.getInputStream();
        DataInputStream dis = new DataInputStream(is);

        dos.writeUTF("芜湖起飞");

        String str = dis.readUTF();
        System.out.println(str);

        dos.writeUTF("憋不住笑了");
    }
}
